import request from '@/utils/request'

// 查询路线备案列表
export function listRegister(query) {
  return request({
    url: '/system/register/list',
    method: 'get',
    params: query
  })
}

/**
 * 获取不带分页的列表
 * @param {*} query
 */
export function findLineList(query) {
  return request({
    url: '/system/register/findList',
    method: 'get',
    params: query
  })
}


// 查询路线备案详细
export function getRegister(id) {
  return request({
    url: '/system/register/getInfo/' + id,
    method: 'get'
  })
}

// 查询路线备案详细
export function getTripListByTid(id) {
  return request({
    url: '/system/tripPoint/getListByTid/' + id,
    method: 'get'
  })
}


// 查询路线备案详细
export function getRouteLine(startCoodr, endCoodr) {
  return request({
    url: '/system/routePlan/findRouteLine?originCoord=' + startCoodr + "&endCoord=" + endCoodr,
    method: 'get'
  })
}

// 新增路线备案
export function addRegister(data) {
  return request({
    url: '/system/register/add',
    method: 'post',
    data: data
  })
}

// 修改路线备案
export function updateRegister(data) {
  return request({
    url: '/system/register/edit',
    method: 'post',
    data: data
  })
}

// 删除路线备案
export function delRegister(id) {
  return request({
    url: '/system/register/remove/' + id,
    method: 'get'
  })
}

export function declRegister(id) {
  return request({
    url: '/system/register/decl/' + id,
    method: 'get'
  })
}

// 导出路线备案
export function exportRegister(query) {
  return request({
    url: '/system/register/export',
    method: 'get',
    params: query
  })
}

